import * as React from 'react';

export interface InterfaceStartProps {
    name: string;
    age: number;
}

export interface InterfaceStartState {
    bug: boolean;
    seed: any;
}

export class Start extends React.Component<InterfaceStartProps, InterfaceStartState> {

    constructor(props: InterfaceStartProps) {
        super(props);

        this.state = {
            bug: false,
            seed: {one: 1},
        };

    }

    public render(): JSX.Element {
        return (
            <div>
                <h1>{this.props.name + 'ok'}</h1>
                <h2>{this.state.seed.one}</h2>
                { this.state.bug ? <h3>Something wrong</h3> : ''}
            </div>
        );
    }

    public componentDidCatch() {
        this.setState({
            bug: true,
        });
    }

}
